home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / cosmic.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  53KB  |  1,560 lines

  1. /***************************************************************************
  2.  
  3. Universal board numbers (found on the schematics)
  4.  
  5. Cosmic Guerilla - 7907A
  6. Cosmic Alien    - 7910
  7. Magical Spot II - 8013
  8. Devil Zone      - 8022
  9.  
  10.  
  11. Space Panic memory map
  12.  
  13. driver by Mike Coates
  14.  
  15. 0000-3FFF ROM
  16. 4000-5BFF Video RAM (Bitmap)
  17. 5C00-5FFF RAM
  18. 6000-601F Sprite Controller
  19.           4 bytes per sprite
  20.  
  21.           byte 1 - 80 = ?
  22.                    40 = Rotate sprite left/right
  23.                    3F = Sprite Number (Conversion to my layout via table)
  24.  
  25.           byte 2 - X co-ordinate
  26.           byte 3 - Y co-ordinate
  27.  
  28.           byte 4 - 08 = Switch sprite bank
  29.                    07 = Colour
  30.  
  31. 6800      IN1 - Player controls. See input port setup for mappings
  32. 6801      IN2 - Player 2 controls for cocktail mode. See input port setup for mappings.
  33. 6802      DSW - Dip switches
  34. 6803      IN0 - Coinage and player start
  35. 700C-700E Colour Map Selector
  36.  
  37. (Not Implemented)
  38.  
  39. 7000-700B Various triggers, Sound etc
  40. 700F      Ditto
  41. 7800      80 = Flash Screen?
  42.  
  43. ***************************************************************************/
  44.  
  45. /***************************************************************************
  46.  
  47. Magical Spot 2 memory map (preliminary)
  48.  
  49. 0000-2fff ROM
  50. 6000-63ff RAM
  51. 6400-7fff Video RAM
  52.  
  53. read:
  54.  
  55. write:
  56.  
  57. ***************************************************************************/
  58.  
  59. /*************************************************************************/
  60. /* Cosmic Guerilla memory map                                             */
  61. /*************************************************************************/
  62. /* 0000-03FF   ROM                          COSMICG.1                    */
  63. /* 0400-07FF   ROM                          COSMICG.2                    */
  64. /* 0800-0BFF   ROM                          COSMICG.3                    */
  65. /* 0C00-0FFF   ROM                          COSMICG.4                    */
  66. /* 1000-13FF   ROM                          COSMICG.5                    */
  67. /* 1400-17FF   ROM                          COSMICG.6                    */
  68. /* 1800-1BFF   ROM                          COSMICG.7                    */
  69. /* 1C00-1FFF   ROM                          COSMICG.8 - Graphics         */
  70. /*                                                                       */
  71. /* 2000-23FF   RAM                                                       */
  72. /* 2400-3FEF   Screen RAM                                                */
  73. /* 3FF0-3FFF   CRT Controller registers (3FF0, register, 3FF4 Data)      */
  74. /*                                                                       */
  75. /* CRTC data                                                             */
  76. /*             ROM                          COSMICG.9 - Color Prom       */
  77. /*                                                                       */
  78. /* CR Bits (Inputs)                                                      */
  79. /* 0000-0003   A9-A13 from CRTC Pixel Clock                              */
  80. /* 0004-000B   Controls                                                  */
  81. /* 000C-000F   Dip Switches                                              */
  82. /*                                                                       */
  83. /* CR Bits (Outputs)                                                     */
  84. /* 0016-0017   Colourmap Selector                                        */
  85. /*************************************************************************/
  86.  
  87. /* R Nabet : One weird thing is that the memory map allows the use of a cheaper tms9980.
  88. Did the original hardware really use the high-end tms9900 ? */
  89. /* Set the flag below to compile with a tms9980. */
  90.  
  91. #define COSMICG_USES_TMS9980 1
  92.  
  93. #include "driver.h"
  94. #include "vidhrdw/generic.h"
  95. #include "cpu/z80/z80.h"
  96.  
  97.  
  98. void panic_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  99. void cosmica_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  100. void cosmicg_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  101. void magspot2_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  102. void panic_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  103. void magspot2_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  104. void cosmica_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  105. void cosmicg_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  106. void nomnlnd_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  107. WRITE_HANDLER( cosmica_videoram_w );
  108. WRITE_HANDLER( cosmica_flipscreen_w );
  109. WRITE_HANDLER( panic_flipscreen_w );
  110. WRITE_HANDLER( panic_color_register_w );
  111. WRITE_HANDLER( cosmicg_color_register_w );
  112. WRITE_HANDLER( nomnlnd_background_w );
  113.  
  114.  
  115. static unsigned int pixel_clock = 0;
  116.  
  117.  
  118. /* Schematics show 12 triggers for discrete sound circuits */
  119.  
  120. static WRITE_HANDLER( panic_sound_output_w )
  121. {
  122.     static int sound_enabled=1;
  123.  
  124.     /* Sound Enable / Disable */
  125.  
  126.     if (offset == 11)
  127.     {
  128.         int count;
  129.         if (data == 0)
  130.             for(count=0; count<9; count++) sample_stop(count);
  131.  
  132.         sound_enabled = data;
  133.     }
  134.  
  135.     if (sound_enabled)
  136.     {
  137.         switch (offset)
  138.         {
  139.         case 0:  if (data) sample_start(0, 0, 0); break;      /* Walk */
  140.         case 1:  if (data) sample_start(0, 5, 0); break;      /* Enemy Die 1 */
  141.         case 2:  if (data)                                      /* Drop 1 */
  142.                  {
  143.                      if (!sample_playing(1))
  144.                      {
  145.                          sample_stop(2);
  146.                          sample_start(1, 3, 0);
  147.                      }
  148.                  }
  149.                  else
  150.                      sample_stop(1);
  151.                      break;
  152.  
  153.         case 3:     if (data && !sample_playing(6))            /* Oxygen */
  154.                     sample_start(6, 9, 1);
  155.                  break;
  156.  
  157.         case 4:  break;                                        /* Drop 2 */
  158.         case 5:  if (data) sample_start(0, 5, 0); break;    /* Enemy Die 2 (use same sample as 1) */
  159.         case 6:  if (data && !sample_playing(1) && !sample_playing(3))   /* Hang */
  160.                      sample_start(2, 2, 0);
  161.                     break;
  162.  
  163.         case 7:  if (data)                                     /* Escape */
  164.                  {
  165.                      sample_stop(2);
  166.                      sample_start(3, 4, 0);
  167.                  }
  168.                  else
  169.                       sample_stop(3);
  170.                      break;
  171.  
  172.         case 8:  if (data) sample_start(0, 1, 0); break;    /* Stairs */
  173.         case 9:  if (data)                                    /* Extend */
  174.                      sample_start(4, 8, 0);
  175.                  else
  176.                     sample_stop(4);
  177.                    break;
  178.  
  179.         case 10: DAC_data_w(0, data); break;                /* Bonus */
  180.         case 15: if (data) sample_start(0, 6, 0); break;    /* Player Die */
  181.         case 16: if (data) sample_start(5, 7, 0); break;    /* Enemy Laugh */
  182.         case 17: if (data) sample_start(0, 10, 0); break;    /* Coin - Not triggered by software */
  183.         }
  184.     }
  185.  
  186.     #ifdef MAME_DEBUG
  187.      logerror("Sound output %x=%x\n",offset,data);
  188.     #endif
  189. }
  190.  
  191. WRITE_HANDLER( panic_sound_output2_w )
  192. {
  193.     panic_sound_output_w(offset+15, data);
  194. }
  195.  
  196. WRITE_HANDLER( cosmicg_output_w )
  197. {
  198.     static int march_select;
  199.     static int gun_die_select;
  200.     static int sound_enabled;
  201.  
  202.     /* Sound Enable / Disable */
  203.  
  204.     if (offset == 12)
  205.     {
  206.         int count;
  207.  
  208.         sound_enabled = data;
  209.         if (data == 0)
  210.             for(count=0;count<9;count++) sample_stop(count);
  211.     }
  212.  
  213.     if (sound_enabled)
  214.     {
  215.         switch (offset)
  216.         {
  217.         /* The schematics show a direct link to the sound amp  */
  218.         /* as other cosmic series games, but it never seems to */
  219.         /* be used for anything. It is implemented for sake of */
  220.         /* completness. Maybe it plays a tune if you win ?     */
  221.         case 1:  DAC_data_w(0, -data); break;
  222.         case 2:  if (data) sample_start (0, march_select, 0); break;    /* March Sound */
  223.         case 3:  march_select = (march_select & 0xfe) | data; break;
  224.         case 4:  march_select = (march_select & 0xfd) | (data << 1); break;
  225.         case 5:  march_select = (march_select & 0xfb) | (data << 2); break;
  226.  
  227.         case 6:  if (data)                              /* Killer Attack (crawly thing at bottom of screen) */
  228.                     sample_start(1, 8, 1);
  229.                  else
  230.                     sample_stop(1);
  231.                  break;
  232.  
  233.         case 7:  if (data)                                /* Bonus Chance & Got Bonus */
  234.                  {
  235.                      sample_stop(4);
  236.                      sample_start(4, 10, 0);
  237.                  }
  238.                  break;
  239.  
  240.         case 8:  if (data)
  241.                  {
  242.                      if (!sample_playing(4)) sample_start(4, 9, 1);
  243.                  }
  244.                  else
  245.                      sample_stop(4);
  246.                  break;
  247.  
  248.         case 9:  if (data) sample_start(3, 11, 0); break;    /* Got Ship */
  249. //        case 11: watchdog_reset_w(0, 0); break;                /* Watchdog */
  250.         case 13: if (data) sample_start(8, 13-gun_die_select, 0); break;  /* Got Monster / Gunshot */
  251.         case 14: gun_die_select = data; break;
  252.         case 15: if (data) sample_start(5, 14, 0); break;    /* Coin Extend (extra base) */
  253.         }
  254.     }
  255.  
  256.     #ifdef MAME_DEBUG
  257.      if (offset != 11) logerror("Output %x=%x\n",offset,data);
  258.     #endif
  259. }
  260.  
  261. static int panic_interrupt(void)
  262. {
  263.     if (cpu_getiloops() != 0)
  264.     {
  265.         /* Coin insert - Trigger Sample */
  266.  
  267.         /* mostly not noticed since sound is */
  268.         /* only enabled if game in progress! */
  269.  
  270.         if ((input_port_3_r(0) & 0xc0) != 0xc0)
  271.             panic_sound_output_w(17,1);
  272.  
  273.         return 0x00cf;        /* RST 08h */
  274.     }
  275.     else
  276.     {
  277.         return 0x00d7;        /* RST 10h */
  278.     }
  279. }
  280.  
  281. static int cosmica_interrupt(void)
  282. {
  283.     pixel_clock = (pixel_clock + 2) & 63;
  284.  
  285.     if (pixel_clock == 0)
  286.     {
  287.         if (readinputport(3) & 1)    /* Left Coin */
  288.             return nmi_interrupt();
  289.         else
  290.             return ignore_interrupt();
  291.     }
  292.     else
  293.            return ignore_interrupt();
  294. }
  295.  
  296. static int cosmicg_interrupt(void)
  297. {
  298.     /* Increment Pixel Clock */
  299.  
  300.     pixel_clock = (pixel_clock + 1) & 15;
  301.  
  302.     /* Insert Coin */
  303.  
  304.     /* R Nabet : fixed to make this piece of code sensible.
  305.     I assumed that the interrupt request lasted for as long as the coin was "sensed".
  306.     It makes sense and works fine, but I cannot be 100% sure this is correct,
  307.     as I have no Cosmic Guerilla console :-) . */
  308.  
  309.     if (pixel_clock == 0)
  310.     {
  311.         if ((readinputport(2) & 1)) /* Coin */
  312.         {
  313. #if COSMICG_USES_TMS9980
  314.             /* on tms9980, a 6 on the interrupt bus means level 4 interrupt */
  315.             cpu_0_irq_line_vector_w(0, 6);
  316. #else
  317.             /* tms9900 is more straightforward */
  318.             cpu_0_irq_line_vector_w(0, 4);
  319. #endif
  320.             cpu_set_irq_line(0, 0, ASSERT_LINE);
  321.         }
  322.         else
  323.         {
  324.             cpu_set_irq_line(0, 0, CLEAR_LINE);
  325.         }
  326.     }
  327.  
  328.     return ignore_interrupt();
  329. }
  330.  
  331. static int magspot2_interrupt(void)
  332. {
  333.     /* Coin 1 causes an IRQ, Coin 2 an NMI */
  334.     if (input_port_4_r(0) & 0x01)
  335.     {
  336.           return interrupt();
  337.     }
  338.  
  339.     if (input_port_4_r(0) & 0x02)
  340.     {
  341.         return nmi_interrupt();
  342.     }
  343.  
  344.     return ignore_interrupt();
  345. }
  346.  
  347.  
  348. READ_HANDLER( cosmica_pixel_clock_r )
  349. {
  350.     return pixel_clock;
  351. }
  352.  
  353. READ_HANDLER( cosmicg_pixel_clock_r )
  354. {
  355.     /* The top four address lines from the CRTC are bits 0-3 */
  356.  
  357.     return (input_port_0_r(0) & 0xf0) | pixel_clock;
  358. }
  359.  
  360. static READ_HANDLER( magspot2_coinage_dip_r )
  361. {
  362.     return (input_port_5_r(0) & (1 << (7 - offset))) ? 0 : 1;
  363. }
  364.  
  365.  
  366. /* Has 8 way joystick, remap combinations to missing directions */
  367.  
  368. static READ_HANDLER( nomnlnd_port_r )
  369. {
  370.     int control;
  371.     int fire = input_port_3_r(0);
  372.  
  373.     if (offset)
  374.         control = input_port_1_r(0);
  375.     else
  376.         control = input_port_0_r(0);
  377.  
  378.     /* If firing - stop tank */
  379.  
  380.     if ((fire & 0xc0) == 0) return 0xff;
  381.  
  382.     /* set bit according to 8 way direction */
  383.  
  384.     if ((control & 0x82) == 0 ) return 0xfe;    /* Up & Left */
  385.     if ((control & 0x0a) == 0 ) return 0xfb;    /* Down & Left */
  386.     if ((control & 0x28) == 0 ) return 0xef;    /* Down & Right */
  387.     if ((control & 0xa0) == 0 ) return 0xbf;    /* Up & Right */
  388.  
  389.     return control;
  390. }
  391.  
  392.  
  393. #if COSMICG_USES_TMS9980
  394.  
  395. /* 8-bit handler */
  396. #define cosmicg_videoram_w cosmica_videoram_w
  397. #define cosmicg_videoram_r MRA_RAM
  398. #define COSMICG_ROM_LOAD ROM_LOAD
  399.  
  400. #else
  401.  
  402. static WRITE_HANDLER( cosmicg_videoram_w )
  403. {
  404.   /* 16-bit handler */
  405.   if (! (data & 0xff000000))
  406.     cosmica_videoram_w(offset, (data >> 8) & 0xff);
  407.   if (! (data & 0x00ff0000))
  408.     cosmica_videoram_w(offset + 1, data & 0xff);
  409. }
  410.  
  411. static READ_HANDLER( cosmicg_videoram_r )
  412. {
  413.     return (videoram[offset] << 8) | videoram[offset+1];
  414. }
  415.  
  416. #define COSMICG_ROM_LOAD ROM_LOAD_WIDE
  417.  
  418. #endif
  419.  
  420.  
  421. static struct MemoryReadAddress panic_readmem[] =
  422. {
  423.     { 0x0000, 0x3fff, MRA_ROM },
  424.     { 0x4000, 0x5fff, MRA_RAM },
  425.     { 0x6800, 0x6800, input_port_0_r }, /* IN1 */
  426.     { 0x6801, 0x6801, input_port_1_r }, /* IN2 */
  427.     { 0x6802, 0x6802, input_port_2_r }, /* DSW */
  428.     { 0x6803, 0x6803, input_port_3_r }, /* IN0 */
  429.     { -1 }    /* end of table */
  430. };
  431.  
  432. static struct MemoryWriteAddress panic_writemem[] =
  433. {
  434.     { 0x0000, 0x3fff, MWA_ROM },
  435.     { 0x4000, 0x5fff, cosmica_videoram_w, &videoram, &videoram_size },
  436.     { 0x6000, 0x601f, MWA_RAM, &spriteram, &spriteram_size },
  437.     { 0x7000, 0x700b, panic_sound_output_w },
  438.     { 0x700c, 0x700e, panic_color_register_w },
  439.     { 0x700f, 0x700f, panic_flipscreen_w },
  440.     { 0x7800, 0x7801, panic_sound_output2_w },
  441.     { -1 }    /* end of table */
  442. };
  443.  
  444. static struct MemoryReadAddress cosmica_readmem[] =
  445. {
  446.     { 0x0000, 0x3fff, MRA_ROM },
  447.     { 0x4000, 0x5fff, MRA_RAM },
  448.     { 0x6800, 0x6800, input_port_0_r }, /* IN1 */
  449.     { 0x6801, 0x6801, input_port_1_r }, /* IN2 */
  450.     { 0x6802, 0x6802, input_port_2_r }, /* DSW */
  451.     { 0x6803, 0x6803, cosmica_pixel_clock_r },
  452.     { -1 }    /* end of table */
  453. };
  454.  
  455. static struct MemoryWriteAddress cosmica_writemem[] =
  456. {
  457.     { 0x0000, 0x3fff, MWA_ROM },
  458.     { 0x4000, 0x5fff, cosmica_videoram_w, &videoram, &videoram_size },
  459.     { 0x6000, 0x601f, MWA_RAM ,&spriteram, &spriteram_size },
  460.     { 0x7000, 0x700b, MWA_RAM },               /* Sound Triggers */
  461.     { 0x700c, 0x700e, panic_color_register_w },
  462.     { 0x700f, 0x700f, cosmica_flipscreen_w },
  463.     { -1 }    /* end of table */
  464. };
  465.  
  466. static struct MemoryReadAddress cosmicg_readmem[] =
  467. {
  468.     { 0x0000, 0x1fff, MRA_ROM },
  469.     { 0x2000, 0x3fff, cosmicg_videoram_r },
  470.     { -1 }    /* end of table */
  471. };
  472.  
  473. static struct MemoryWriteAddress cosmicg_writemem[] =
  474. {
  475.     { 0x0000, 0x1fff, MWA_ROM },
  476.     { 0x2000, 0x3fff, cosmicg_videoram_w, &videoram, &videoram_size },
  477.     { -1 }    /* end of table */
  478. };
  479.  
  480. static struct IOReadPort cosmicg_readport[] =
  481. {
  482.     { 0x00, 0x00, cosmicg_pixel_clock_r },
  483.     { 0x01, 0x01, input_port_1_r },
  484.     { -1 }    /* end of table */
  485. };
  486.  
  487. static struct IOWritePort cosmicg_writeport[] =
  488. {
  489.     { 0x00, 0x15, cosmicg_output_w },
  490.     { 0x16, 0x17, cosmicg_color_register_w },
  491.     { -1 }    /* end of table */
  492. };
  493.  
  494. static struct MemoryReadAddress magspot2_readmem[] =
  495. {
  496.     { 0x0000, 0x2fff, MRA_ROM },
  497.     { 0x3800, 0x3807, magspot2_coinage_dip_r },
  498.     { 0x5000, 0x5000, input_port_0_r },
  499.     { 0x5001, 0x5001, input_port_1_r },
  500.     { 0x5002, 0x5002, input_port_2_r },
  501.     { 0x5003, 0x5003, input_port_3_r },
  502.     { 0x6000, 0x7fff, MRA_RAM },
  503.     { -1 }    /* end of table */
  504. };
  505.  
  506. static struct MemoryWriteAddress magspot2_writemem[] =
  507. {
  508.     { 0x0000, 0x2fff, MWA_ROM },
  509.     { 0x4000, 0x401f, MWA_RAM, &spriteram, &spriteram_size},
  510.     { 0x4800, 0x4800, DAC_0_data_w },
  511.     { 0x480c, 0x480e, panic_color_register_w },
  512.     { 0x480f, 0x480f, cosmica_flipscreen_w },
  513.     { 0x6000, 0x7fff, cosmica_videoram_w, &videoram, &videoram_size},
  514.     { -1 }    /* end of table */
  515. };
  516.  
  517. static struct MemoryReadAddress nomnlnd_readmem[] =
  518. {
  519.     { 0x0000, 0x2fff, MRA_ROM },
  520.     { 0x3800, 0x3807, magspot2_coinage_dip_r },
  521.     { 0x5000, 0x5001, nomnlnd_port_r },
  522.     { 0x5002, 0x5002, input_port_2_r },
  523.     { 0x5003, 0x5003, input_port_3_r },
  524.     { 0x6000, 0x7fff, MRA_RAM },
  525.     { -1 }    /* end of table */
  526. };
  527.  
  528. static struct MemoryWriteAddress nomnlnd_writemem[] =
  529. {
  530.     { 0x0000, 0x2fff, MWA_ROM },
  531.     { 0x4000, 0x401f, MWA_RAM, &spriteram, &spriteram_size},
  532.     { 0x4807, 0x4807, nomnlnd_background_w },
  533.     { 0x480a, 0x480a, DAC_0_data_w },
  534.     { 0x480c, 0x480e, panic_color_register_w },
  535.     { 0x480f, 0x480f, cosmica_flipscreen_w },
  536.     { 0x6000, 0x7fff, cosmica_videoram_w, &videoram, &videoram_size},
  537.     { -1 }    /* end of table */
  538. };
  539.  
  540.  
  541. INPUT_PORTS_START( panic )
  542.     PORT_START      /* IN1 */
  543.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  544.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  545.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY )
  546.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
  547.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
  548.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  549.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  550.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
  551.  
  552.     PORT_START      /* IN2 */
  553.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  554.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  555.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY | IPF_COCKTAIL )
  556.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY | IPF_COCKTAIL )
  557.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY | IPF_COCKTAIL )
  558.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  559.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  560.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  561.  
  562.     PORT_START      /* DSW */
  563.     PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_A ) )
  564.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  565.     PORT_DIPSETTING(    0x05, DEF_STR( 2C_3C ) )
  566.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  567.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
  568.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
  569.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
  570. /* 0x06 and 0x07 disabled */
  571.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  572.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  573.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  574.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) )
  575.     PORT_DIPSETTING(    0x00, "3000" )
  576.     PORT_DIPSETTING(    0x10, "5000" )
  577.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Lives ) )
  578.     PORT_DIPSETTING(    0x00, "3" )
  579.     PORT_DIPSETTING(    0x20, "4" )
  580.     PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Coin_B ) )
  581.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  582.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
  583.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  584.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_3C ) )
  585.  
  586.     PORT_START      /* IN0 */
  587.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  588.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  589.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  590.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  591.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  592.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  593.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  594.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
  595.  
  596. INPUT_PORTS_END
  597.  
  598. INPUT_PORTS_START( cosmica )
  599.     PORT_START      /* IN0 */
  600.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  601.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  602.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  603.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  604.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  605.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  606.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  607.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  608.  
  609.     PORT_START      /* IN1 */
  610.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  611.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  612.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  613.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  614.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  615.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  616.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  617.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  618.  
  619.     PORT_START      /* IN2 */
  620.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
  621.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  622.     PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
  623.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Lives ) )
  624.     PORT_DIPSETTING(    0x02, "3" )
  625.     PORT_DIPSETTING(    0x00, "5" )
  626.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
  627.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  628.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  629.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
  630. /* 0c gives 1C_1C */
  631.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
  632.     PORT_DIPSETTING(    0x30, "5000" )
  633.     PORT_DIPSETTING(    0x20, "10000" )
  634.     PORT_DIPSETTING(    0x10, "15000" )
  635.     PORT_DIPSETTING(    0x00, "None" )
  636.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  637.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  638.  
  639.     /* The coin slots are not memory mapped. Coin  causes a NMI, */
  640.     /* This fake input port is used by the interrupt */
  641.     /* handler to be notified of coin insertions. We use IMPULSE to */
  642.     /* trigger exactly one interrupt, without having to check when the */
  643.     /* user releases the key. */
  644.  
  645.     PORT_START    /* FAKE */
  646.     PORT_BIT_IMPULSE( 0x01, IP_ACTIVE_HIGH, IPT_COIN1, 1 )
  647.  
  648. INPUT_PORTS_END
  649.  
  650. /* These are used for the CR handling - This can be used to */
  651. /* from 1 to 16 bits from any bit offset between 0 and 4096 */
  652.  
  653. /* Offsets are in BYTES, so bits 0-7 are at offset 0 etc.   */
  654.  
  655. INPUT_PORTS_START( cosmicg )
  656.     PORT_START /* 4-7 */
  657.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
  658.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
  659.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
  660.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  661.  
  662.     PORT_START /* 8-15 */
  663.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  664.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  665.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL)
  666.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL)
  667.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
  668.     PORT_DIPSETTING(    0x10, "1000" )
  669.     PORT_DIPSETTING(    0x20, "1500" )
  670.     PORT_DIPSETTING(    0x30, "2000" )
  671.     PORT_DIPSETTING(    0x00, "None" )
  672.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
  673.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  674.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  675.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Lives ) )
  676.     PORT_DIPSETTING(    0x00, "3" )
  677.     PORT_DIPSETTING(    0x80, "5" )
  678.  
  679.     PORT_START      /* Hard wired settings */
  680.  
  681.     /* The coin slots are not memory mapped. Coin causes INT 4  */
  682.     /* This fake input port is used by the interrupt handler     */
  683.     /* to be notified of coin insertions. */
  684.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  685.  
  686.     /* This dip switch is not read by the program at any time   */
  687.     /* but is wired to enable or disable the flip screen output */
  688.  
  689.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
  690.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  691.     PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
  692.  
  693.     /* This odd setting is marked as shown on the schematic,    */
  694.     /* and again, is not read by the program, but wired into    */
  695.     /* the watchdog circuit. The book says to leave it off      */
  696.  
  697.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
  698.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  699.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  700.  
  701. INPUT_PORTS_END
  702.  
  703. INPUT_PORTS_START( magspot2 )
  704.     PORT_START    /* IN0 */
  705.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
  706.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  707.     PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNUSED )
  708.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  709.     PORT_DIPNAME( 0xc0, 0x40, "Bonus Game" )
  710.     PORT_DIPSETTING(    0x40, "5000" )
  711.     PORT_DIPSETTING(    0x80, "10000" )
  712.     PORT_DIPSETTING(    0xc0, "15000" )
  713.     PORT_DIPSETTING(    0x00, "None" )
  714.  
  715.     PORT_START    /* IN1 */
  716.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
  717.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  718.     PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNUSED )
  719.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  720.     PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
  721.  
  722.     PORT_START    /* IN2 */
  723.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
  724.     PORT_DIPSETTING(    0x01, "2000" )
  725.     PORT_DIPSETTING(    0x02, "3000" )
  726.     PORT_DIPSETTING(    0x03, "5000" )
  727.     PORT_DIPSETTING(    0x00, "None" )
  728.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  729.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  730.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  731.     PORT_DIPNAME( 0x18, 0x08, DEF_STR( Lives ) )
  732.     PORT_DIPSETTING(    0x00, "2" )
  733.     PORT_DIPSETTING(    0x08, "3" )
  734.     PORT_DIPSETTING(    0x10, "4" )
  735.     PORT_DIPSETTING(    0x18, "5" )
  736.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  737.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  738.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  739.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  740.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  741.  
  742.     PORT_START    /* IN3 */
  743.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
  744.     PORT_BIT( 0x3e, IP_ACTIVE_LOW, IPT_UNUSED )
  745.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  746.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
  747.  
  748.     /* Fake port to handle coins */
  749.     PORT_START    /* IN4 */
  750.     PORT_BIT_IMPULSE( 0x01, IP_ACTIVE_HIGH, IPT_COIN1, 1 )
  751.     PORT_BIT_IMPULSE( 0x02, IP_ACTIVE_HIGH, IPT_COIN2, 1 )
  752.  
  753.     /* Fake port to handle coinage dip switches. Each bit goes to 3800-3807 */
  754.     PORT_START    /* IN5 */
  755.     PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) )
  756.     PORT_DIPSETTING(    0x0c, DEF_STR( 4C_1C ) )
  757.     PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
  758.     PORT_DIPSETTING(    0x0d, DEF_STR( 4C_2C ) )
  759.     PORT_DIPSETTING(    0x05, DEF_STR( 2C_1C ) )
  760.     PORT_DIPSETTING(    0x09, DEF_STR( 3C_2C ) )
  761.     PORT_DIPSETTING(    0x0e, DEF_STR( 4C_3C ) )
  762.     PORT_DIPSETTING(    0x0f, DEF_STR( 4C_4C ) )
  763.     PORT_DIPSETTING(    0x0a, DEF_STR( 3C_3C ) )
  764.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_2C ) )
  765.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  766.     PORT_DIPSETTING(    0x0b, DEF_STR( 3C_4C ) )
  767.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  768.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  769.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
  770.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
  771.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
  772.     PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_B ) )
  773.     PORT_DIPSETTING(    0xc0, DEF_STR( 4C_1C ) )
  774.     PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
  775.     PORT_DIPSETTING(    0xd0, DEF_STR( 4C_2C ) )
  776.     PORT_DIPSETTING(    0x50, DEF_STR( 2C_1C ) )
  777.     PORT_DIPSETTING(    0x90, DEF_STR( 3C_2C ) )
  778.     PORT_DIPSETTING(    0xe0, DEF_STR( 4C_3C ) )
  779.     PORT_DIPSETTING(    0xf0, DEF_STR( 4C_4C ) )
  780.     PORT_DIPSETTING(    0xa0, DEF_STR( 3C_3C ) )
  781.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_2C ) )
  782.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  783.     PORT_DIPSETTING(    0xb0, DEF_STR( 3C_4C ) )
  784.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  785.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
  786.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
  787.     PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
  788.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
  789. INPUT_PORTS_END
  790.  
  791. INPUT_PORTS_START( devzone )
  792.     PORT_START    /* IN0 */
  793.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
  794.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  795.     PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNUSED )
  796.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  797.     PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
  798.  
  799.     PORT_START    /* IN1 */
  800.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
  801.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  802.     PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNUSED )
  803.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  804.     PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
  805.  
  806.     PORT_START    /* IN2 */
  807.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
  808.     PORT_DIPSETTING(    0x01, "4000" )
  809.     PORT_DIPSETTING(    0x02, "6000" )
  810.     PORT_DIPSETTING(    0x03, "8000" )
  811.     PORT_DIPSETTING(    0x00, "None" )
  812.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coinage ) )
  813.     PORT_DIPSETTING(    0x0c, "Use Coin A & B" )
  814.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  815.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  816.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  817.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Lives ) )
  818.     PORT_DIPSETTING(    0x00, "2" )
  819.     PORT_DIPSETTING(    0x10, "3" )
  820.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  821.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  822.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  823.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  824.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  825.  
  826.     PORT_START    /* IN3 */
  827.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK )
  828.     PORT_BIT( 0x3e, IP_ACTIVE_LOW, IPT_UNUSED )
  829.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  830.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
  831.  
  832.     /* Fake port to handle coins */
  833.     PORT_START    /* IN4 */
  834.     PORT_BIT_IMPULSE( 0x01, IP_ACTIVE_HIGH, IPT_COIN1, 1 )
  835.     PORT_BIT_IMPULSE( 0x02, IP_ACTIVE_HIGH, IPT_COIN2, 1 )
  836.  
  837.     PORT_START    /* IN5 */
  838.     PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) )
  839.     PORT_DIPSETTING(    0x0c, DEF_STR( 4C_1C ) )
  840.     PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
  841.     PORT_DIPSETTING(    0x0d, DEF_STR( 4C_2C ) )
  842.     PORT_DIPSETTING(    0x05, DEF_STR( 2C_1C ) )
  843.     PORT_DIPSETTING(    0x09, DEF_STR( 3C_2C ) )
  844.     PORT_DIPSETTING(    0x0e, DEF_STR( 4C_3C ) )
  845.     PORT_DIPSETTING(    0x0f, DEF_STR( 4C_4C ) )
  846.     PORT_DIPSETTING(    0x0a, DEF_STR( 3C_3C ) )
  847.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_2C ) )
  848.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  849.     PORT_DIPSETTING(    0x0b, DEF_STR( 3C_4C ) )
  850.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  851.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  852.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
  853.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
  854.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
  855.     PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_B ) )
  856.     PORT_DIPSETTING(    0xc0, DEF_STR( 4C_1C ) )
  857.     PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
  858.     PORT_DIPSETTING(    0xd0, DEF_STR( 4C_2C ) )
  859.     PORT_DIPSETTING(    0x50, DEF_STR( 2C_1C ) )
  860.     PORT_DIPSETTING(    0x90, DEF_STR( 3C_2C ) )
  861.     PORT_DIPSETTING(    0xe0, DEF_STR( 4C_3C ) )
  862.     PORT_DIPSETTING(    0xf0, DEF_STR( 4C_4C ) )
  863.     PORT_DIPSETTING(    0xa0, DEF_STR( 3C_3C ) )
  864.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_2C ) )
  865.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  866.     PORT_DIPSETTING(    0xb0, DEF_STR( 3C_4C ) )
  867.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  868.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
  869.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
  870.     PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
  871.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
  872. INPUT_PORTS_END
  873.  
  874. INPUT_PORTS_START( nomnlnd )
  875.     PORT_START    /* Controls - Remapped for game */
  876.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  877.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  878.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  879.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  880.     PORT_BIT( 0x55, IP_ACTIVE_LOW, IPT_UNUSED )
  881.  
  882.     PORT_START    /* IN1 */
  883.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  884.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  885.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  886.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  887.     PORT_BIT( 0x55, IP_ACTIVE_LOW, IPT_UNUSED )
  888.  
  889.     PORT_START    /* IN2 */
  890.     PORT_DIPNAME( 0x03, 0x02, DEF_STR( Bonus_Life ) )
  891.     PORT_DIPSETTING(    0x01, "2000" )
  892.     PORT_DIPSETTING(    0x02, "3000" )
  893.     PORT_DIPSETTING(    0x03, "5000" )
  894.     PORT_DIPSETTING(    0x00, "None" )
  895.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
  896.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  897.        PORT_DIPSETTING(    0x0c, DEF_STR( 2C_2C ) )
  898.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  899.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  900.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Lives ) )
  901.     PORT_DIPSETTING(    0x00, "3" )
  902.     PORT_DIPSETTING(    0x10, "5" )
  903.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  904.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  905.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  906.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  907.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  908.  
  909.     PORT_START    /* IN3 */
  910.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK )
  911.     PORT_BIT( 0x3e, IP_ACTIVE_LOW, IPT_UNUSED )
  912.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  913.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
  914.  
  915.     /* Fake port to handle coin */
  916.     PORT_START    /* IN4 */
  917.     PORT_BIT_IMPULSE( 0x02, IP_ACTIVE_HIGH, IPT_COIN1, 1 )
  918.  
  919.     PORT_START    /* IN5 */
  920.     PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coinage ) )
  921.     PORT_DIPSETTING(    0xc0, DEF_STR( 4C_1C ) )
  922.     PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
  923.     PORT_DIPSETTING(    0xd0, DEF_STR( 4C_2C ) )
  924.     PORT_DIPSETTING(    0x50, DEF_STR( 2C_1C ) )
  925.     PORT_DIPSETTING(    0x90, DEF_STR( 3C_2C ) )
  926.     PORT_DIPSETTING(    0xe0, DEF_STR( 4C_3C ) )
  927.     PORT_DIPSETTING(    0xf0, DEF_STR( 4C_4C ) )
  928.     PORT_DIPSETTING(    0xa0, DEF_STR( 3C_3C ) )
  929.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_2C ) )
  930.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  931.     PORT_DIPSETTING(    0xb0, DEF_STR( 3C_4C ) )
  932.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  933.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
  934.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
  935.     PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
  936.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
  937.  
  938. INPUT_PORTS_END
  939.  
  940.  
  941. static struct GfxLayout panic_spritelayout0 =
  942. {
  943.     16,16,    /* 16*16 sprites */
  944.     48 ,    /* 64 sprites */
  945.     2,        /* 2 bits per pixel */
  946.     { 4096*8, 0 },    /* the two bitplanes are separated */
  947.     { 0,1,2,3,4,5,6,7,16*8+0,16*8+1,16*8+2,16*8+3,16*8+4,16*8+5,16*8+6,16*8+7 },
  948.        { 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8, 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
  949.     32*8    /* every sprite takes 32 consecutive bytes */
  950. };
  951.  
  952. static struct GfxLayout panic_spritelayout1 =
  953. {
  954.     16,16,    /* 16*16 sprites */
  955.     16 ,    /* 16 sprites */
  956.     2,        /* 2 bits per pixel */
  957.     { 4096*8, 0 },    /* the two bitplanes are separated */
  958.     { 0,1,2,3,4,5,6,7,16*8+0,16*8+1,16*8+2,16*8+3,16*8+4,16*8+5,16*8+6,16*8+7 },
  959.       { 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8, 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
  960.     32*8    /* every sprite takes 32 consecutive bytes */
  961. };
  962.  
  963. static struct GfxLayout cosmica_spritelayout16 =
  964. {
  965.     16,16,                /* 16*16 sprites */
  966.     64,                    /* 64 sprites */
  967.     2,                    /* 2 bits per pixel */
  968.     { 64*16*16, 0 },    /* the two bitplanes are separated */
  969.     { 0,1,2,3,4,5,6,7,16*8+0,16*8+1,16*8+2,16*8+3,16*8+4,16*8+5,16*8+6,16*8+7},
  970.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  971.     32*8                /* every sprite takes 32 consecutive bytes */
  972. };
  973.  
  974. static struct GfxLayout cosmica_spritelayout32 =
  975. {
  976.     32,32,                /* 32*32 sprites */
  977.     16,                    /* 16 sprites */
  978.     2,                    /* 2 bits per pixel */
  979.     { 64*16*16, 0 },    /* the two bitplanes are separated */
  980.     { 0,1,2,3,4,5,6,7,
  981.       32*8+0, 32*8+1, 32*8+2, 32*8+3, 32*8+4, 32*8+5, 32*8+6, 32*8+7,
  982.       64*8+0, 64*8+1, 64*8+2, 64*8+3, 64*8+4, 64*8+5, 64*8+6, 64*8+7,
  983.         96*8+0, 96*8+1, 96*8+2, 96*8+3, 96*8+4, 96*8+5, 96*8+6, 96*8+7 },
  984.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8, 16*8, 17*8,18*8,19*8,20*8,21*8,22*8,23*8,24*8,25*8,26*8,27*8,28*8,29*8,30*8,31*8 },
  985.     128*8                /* every sprite takes 128 consecutive bytes */
  986. };
  987.  
  988. static struct GfxLayout nomnlnd_treelayout =
  989. {
  990.     32,32,                /* 32*32 sprites */
  991.     4,                    /* 4 sprites */
  992.     2,                    /* 2 bits per pixel */
  993.     { 0, 8*128*8 },    /* the two bitplanes are separated */
  994.     { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 },
  995.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32,
  996.      16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32, 24*32, 25*32, 26*32, 27*32, 28*32, 29*32, 30*32, 31*32 },
  997.     128*8                /* every sprite takes 128 consecutive bytes */
  998. };
  999.  
  1000. static struct GfxLayout nomnlnd_waterlayout =
  1001. {
  1002.     16,32,                /* 16*32 sprites */
  1003.     32,                    /* 32 sprites */
  1004.     2,                    /* 2 bits per pixel */
  1005.     { 0, 8*128*8 },    /* the two bitplanes are separated */
  1006.     { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 },
  1007.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32,
  1008.      16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32, 24*32, 25*32, 26*32, 27*32, 28*32, 29*32, 30*32, 31*32 },
  1009.     32                 /* To create a set of sprites 1 pixel displaced */
  1010. };
  1011.  
  1012. static struct GfxDecodeInfo panic_gfxdecodeinfo[] =
  1013. {
  1014.     { REGION_GFX1, 0x0a00, &panic_spritelayout0, 0, 8 },    /* Monsters              0a00-0fff */
  1015.     { REGION_GFX1, 0x0200, &panic_spritelayout0, 0, 8 },    /* Monsters eating Man   0200-07ff */
  1016.     { REGION_GFX1, 0x0800, &panic_spritelayout1, 0, 8 },    /* Man                   0800-09ff */
  1017.     { -1 } /* end of array */
  1018. };
  1019.  
  1020. static struct GfxDecodeInfo cosmica_gfxdecodeinfo[] =
  1021. {
  1022.     { REGION_GFX1, 0, &cosmica_spritelayout16,  0, 16 },
  1023.     { REGION_GFX1, 0, &cosmica_spritelayout32,  0, 16 },
  1024.     { -1 } /* end of array */
  1025. };
  1026.  
  1027. static struct GfxDecodeInfo magspot2_gfxdecodeinfo[] =
  1028. {
  1029.     { REGION_GFX1, 0, &cosmica_spritelayout16,  0, 8 },
  1030.     { REGION_GFX1, 0, &cosmica_spritelayout32,  0, 8 },
  1031.     { -1 } /* end of array */
  1032. };
  1033.  
  1034. static struct GfxDecodeInfo nomnlnd_gfxdecodeinfo[] =
  1035. {
  1036.     { REGION_GFX1, 0x0000, &cosmica_spritelayout16,  0,  8 },
  1037.     { REGION_GFX1, 0x0000, &cosmica_spritelayout32,  0,  8 },
  1038.     { REGION_GFX2, 0x0000, &nomnlnd_treelayout,      0,  9 },
  1039.     { REGION_GFX2, 0x0200, &nomnlnd_waterlayout,     0,  10 },
  1040.     { -1 } /* end of array */
  1041. };
  1042.  
  1043.  
  1044. static struct DACinterface dac_interface =
  1045. {
  1046.     1,
  1047.     { 100 }
  1048. };
  1049.  
  1050. static const char *panic_sample_names[] =
  1051. {
  1052.     "*panic",
  1053.     "walk.wav",
  1054.     "upordown.wav",
  1055.     "trapped.wav",
  1056.     "falling.wav",
  1057.     "escaping.wav",
  1058.     "ekilled.wav",
  1059.     "death.wav",
  1060.     "elaugh.wav",
  1061.     "extral.wav",
  1062.     "oxygen.wav",
  1063.     "coin.wav",
  1064.     0       /* end of array */
  1065. };
  1066.  
  1067. static struct Samplesinterface panic_samples_interface =
  1068. {
  1069.     9,    /* 9 channels */
  1070.     25,    /* volume */
  1071.     panic_sample_names
  1072. };
  1073.  
  1074. static const char *cosmicg_sample_names[] =
  1075. {
  1076.     "*cosmicg",
  1077.     "cg_m0.wav",    /* 8 Different pitches of March Sound */
  1078.     "cg_m1.wav",
  1079.     "cg_m2.wav",
  1080.     "cg_m3.wav",
  1081.     "cg_m4.wav",
  1082.     "cg_m5.wav",
  1083.     "cg_m6.wav",
  1084.     "cg_m7.wav",
  1085.     "cg_att.wav",    /* Killer Attack */
  1086.     "cg_chnc.wav",    /* Bonus Chance  */
  1087.     "cg_gotb.wav",    /* Got Bonus - have not got correct sound for */
  1088.     "cg_dest.wav",    /* Gun Destroy */
  1089.     "cg_gun.wav",    /* Gun Shot */
  1090.     "cg_gotm.wav",    /* Got Monster */
  1091.     "cg_ext.wav",    /* Coin Extend */
  1092.     0       /* end of array */
  1093. };
  1094.  
  1095. static struct Samplesinterface cosmicg_samples_interface =
  1096. {
  1097.     9,    /* 9 channels */
  1098.     25,    /* volume */
  1099.     cosmicg_sample_names
  1100. };
  1101.  
  1102.  
  1103. static struct MachineDriver machine_driver_panic =
  1104. {
  1105.     /* basic machine hardware */
  1106.     {
  1107.         {
  1108.             CPU_Z80,
  1109.             2000000,    /* 2 Mhz? */
  1110.             panic_readmem,panic_writemem,0,0,
  1111.             panic_interrupt,2
  1112.         }
  1113.     },
  1114.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  1115.     1,    /* single CPU, no need for interleaving */
  1116.     0,
  1117.  
  1118.     /* video hardware */
  1119.       32*8, 32*8, { 0*8, 32*8-1, 4*8, 28*8-1 },
  1120.     panic_gfxdecodeinfo,
  1121.     16, 8*4,
  1122.     panic_vh_convert_color_prom,
  1123.  
  1124.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
  1125.     0,
  1126.     generic_bitmapped_vh_start,
  1127.     generic_bitmapped_vh_stop,
  1128.     panic_vh_screenrefresh,
  1129.  
  1130.     /* sound hardware */
  1131.     0,0,0,0,
  1132.     {
  1133.         {
  1134.             SOUND_SAMPLES,
  1135.             &panic_samples_interface
  1136.         },
  1137.         {
  1138.             SOUND_DAC,
  1139.             &dac_interface
  1140.         }
  1141.     }
  1142. };
  1143.  
  1144. static struct MachineDriver machine_driver_cosmica =
  1145. {
  1146.     /* basic machine hardware */
  1147.     {
  1148.         {
  1149.             CPU_Z80,
  1150.             1081600,
  1151.             cosmica_readmem,cosmica_writemem,0,0,
  1152.             cosmica_interrupt,32
  1153.         }
  1154.     },
  1155.     60, 2500,    /* frames per second, vblank duration */
  1156.     1,    /* single CPU, no need for interleaving */
  1157.     0,
  1158.  
  1159.     /* video hardware */
  1160.       32*8, 32*8, { 0*8, 32*8-1, 4*8, 28*8-1 },
  1161.     cosmica_gfxdecodeinfo,
  1162.     8, 16*4,
  1163.     cosmica_vh_convert_color_prom,
  1164.  
  1165.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
  1166.     0,
  1167.     generic_bitmapped_vh_start,
  1168.     generic_bitmapped_vh_stop,
  1169.     cosmica_vh_screenrefresh,
  1170.  
  1171.     /* sound hardware */
  1172.     0,0,0,0
  1173. };
  1174.  
  1175. static struct MachineDriver machine_driver_cosmicg =
  1176. {
  1177.     /* basic machine hardware */
  1178.     {
  1179.         {
  1180. #if COSMICG_USES_TMS9980
  1181.             CPU_TMS9980,
  1182. #else
  1183.             CPU_TMS9900,
  1184. #endif
  1185.             1228500,            /* 9.828 Mhz Crystal */
  1186.             /* R Nabet : huh ? This would imply the crystal frequency is somehow divided by 2 before being
  1187.             fed to the tms9904 or tms9980.  Also, I have never heard of a tms9900/9980 operating under
  1188.             1.5MHz.  So, if someone can check this... */
  1189.             cosmicg_readmem,cosmicg_writemem,
  1190.             cosmicg_readport,cosmicg_writeport,
  1191.             cosmicg_interrupt,16
  1192.         }
  1193.     },
  1194.     60, 0,        /* frames per second, vblank duration */
  1195.     1,            /* single CPU, no need for interleaving */
  1196.     0,
  1197.  
  1198.     /* video hardware */
  1199.       32*8, 32*8, { 0*8, 32*8-1, 4*8, 28*8-1 },
  1200.     0,             /* no gfxdecodeinfo - bitmapped display */
  1201.     16,0,
  1202.     cosmicg_vh_convert_color_prom,
  1203.  
  1204.     VIDEO_TYPE_RASTER,
  1205.     0,
  1206.     generic_bitmapped_vh_start,
  1207.     generic_bitmapped_vh_stop,
  1208.     cosmicg_vh_screenrefresh,
  1209.  
  1210.     /* sound hardware */
  1211.     0,0,0,0,
  1212.     {
  1213.         {
  1214.             SOUND_SAMPLES,
  1215.             &cosmicg_samples_interface
  1216.         },
  1217.         {
  1218.             SOUND_DAC,
  1219.             &dac_interface
  1220.         }
  1221.     }
  1222. };
  1223.  
  1224. static struct MachineDriver machine_driver_magspot2 =
  1225. {
  1226.     /* basic machine hardware */
  1227.     {
  1228.         {
  1229.             CPU_Z80,
  1230.             18432000/6,    /* 3.072 Mhz ???? */
  1231.             magspot2_readmem,magspot2_writemem,0,0,
  1232.             magspot2_interrupt,1
  1233.         },
  1234.     },
  1235.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  1236.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1237.     0,
  1238.  
  1239.     /* video hardware */
  1240.       32*8, 32*8, { 0*8, 32*8-1, 4*8, 28*8-1 },
  1241.     magspot2_gfxdecodeinfo,
  1242.     16, 8*4,
  1243.     magspot2_vh_convert_color_prom,
  1244.  
  1245.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
  1246.     0,
  1247.     generic_bitmapped_vh_start,
  1248.     generic_bitmapped_vh_stop,
  1249.     magspot2_vh_screenrefresh,
  1250.  
  1251.     /* sound hardware */
  1252.     0,0,0,0,
  1253.     {
  1254.         {
  1255.             SOUND_DAC,
  1256.             &dac_interface
  1257.         }
  1258.     }
  1259. };
  1260.  
  1261. static struct MachineDriver machine_driver_nomnlnd =
  1262. {
  1263.     /* basic machine hardware */
  1264.     {
  1265.         {
  1266.             CPU_Z80,
  1267.             18432000/6,    /* 3.072 Mhz ???? */
  1268.             nomnlnd_readmem,nomnlnd_writemem,0,0,
  1269.             magspot2_interrupt,1
  1270.         },
  1271.     },
  1272.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  1273.     1,    /* 1 CPU slice per frame */
  1274.     0,
  1275.  
  1276.     /* video hardware */
  1277.       32*8, 32*8, { 0*8, 32*8-1, 4*8, 28*8-1 },
  1278.     nomnlnd_gfxdecodeinfo,
  1279.     16, 16*4,
  1280.     magspot2_vh_convert_color_prom,
  1281.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
  1282.     0,
  1283.     generic_bitmapped_vh_start,
  1284.     generic_bitmapped_vh_stop,
  1285.     nomnlnd_vh_screenrefresh,
  1286.  
  1287.     /* sound hardware */
  1288.     0,0,0,0,
  1289.     {
  1290.         {
  1291.             SOUND_DAC,
  1292.             &dac_interface
  1293.         }
  1294.     }
  1295. };
  1296.  
  1297.  
  1298. static void init_cosmicg(void)
  1299. {
  1300.     /* Roms have data pins connected different from normal */
  1301.  
  1302.     int count;
  1303.     unsigned char scrambled,normal;
  1304.  
  1305.     for(count=0x1fff;count>=0;count--)
  1306.     {
  1307.         scrambled = memory_region(REGION_CPU1)[count];
  1308.  
  1309.         normal = (scrambled >> 3 & 0x11)
  1310.                | (scrambled >> 1 & 0x22)
  1311.                | (scrambled << 1 & 0x44)
  1312.                | (scrambled << 3 & 0x88);
  1313.  
  1314.         memory_region(REGION_CPU1)[count] = normal;
  1315.     }
  1316.  
  1317.     /* Patch to avoid crash - Seems like duff romcheck routine */
  1318.     /* I would expect it to be bitrot, but have two romsets    */
  1319.     /* from different sources with the same problem!           */
  1320.  
  1321. #if COSMICG_USES_TMS9980
  1322.     memory_region(REGION_CPU1)[0x1e9e] = 0x04;
  1323.     memory_region(REGION_CPU1)[0x1e9f] = 0xc0;
  1324. #else
  1325.     WRITE_WORD(memory_region(REGION_CPU1) + 0x1e9e, 0x04c0);
  1326. #endif
  1327. }
  1328.  
  1329.  
  1330. ROM_START( panic )
  1331.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1332.     ROM_LOAD( "spcpanic.1",   0x0000, 0x0800, 0x405ae6f9 )
  1333.     ROM_LOAD( "spcpanic.2",   0x0800, 0x0800, 0xb6a286c5 )
  1334.     ROM_LOAD( "spcpanic.3",   0x1000, 0x0800, 0x85ae8b2e )
  1335.     ROM_LOAD( "spcpanic.4",   0x1800, 0x0800, 0xb6d4f52f )
  1336.     ROM_LOAD( "spcpanic.5",   0x2000, 0x0800, 0x5b80f277 )
  1337.     ROM_LOAD( "spcpanic.6",   0x2800, 0x0800, 0xb73babf0 )
  1338.     ROM_LOAD( "spcpanic.7",   0x3000, 0x0800, 0xfc27f4e5 )
  1339.  
  1340.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1341.     ROM_LOAD( "spcpanic.9",   0x0000, 0x0800, 0xeec78b4c )
  1342.     ROM_LOAD( "spcpanic.10",  0x0800, 0x0800, 0xc9631c2d )
  1343.     ROM_LOAD( "spcpanic.12",  0x1000, 0x0800, 0xe83423d0 )
  1344.     ROM_LOAD( "spcpanic.11",  0x1800, 0x0800, 0xacea9df4 )
  1345.  
  1346.     ROM_REGION( 0x0020, REGION_PROMS )
  1347.     ROM_LOAD( "82s123.sp",    0x0000, 0x0020, 0x35d43d2f )
  1348.  
  1349.     ROM_REGION( 0x0800, REGION_USER1 ) /* color map */
  1350.     ROM_LOAD( "spcpanic.8",   0x0000, 0x0800, 0x7da0b321 )
  1351. ROM_END
  1352.  
  1353. ROM_START( panica )
  1354.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1355.     ROM_LOAD( "panica.1",     0x0000, 0x0800, 0x289720ce )
  1356.     ROM_LOAD( "spcpanic.2",   0x0800, 0x0800, 0xb6a286c5 )
  1357.     ROM_LOAD( "spcpanic.3",   0x1000, 0x0800, 0x85ae8b2e )
  1358.     ROM_LOAD( "spcpanic.4",   0x1800, 0x0800, 0xb6d4f52f )
  1359.     ROM_LOAD( "spcpanic.5",   0x2000, 0x0800, 0x5b80f277 )
  1360.     ROM_LOAD( "spcpanic.6",   0x2800, 0x0800, 0xb73babf0 )
  1361.     ROM_LOAD( "panica.7",     0x3000, 0x0800, 0x3641cb7f )
  1362.  
  1363.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1364.     ROM_LOAD( "spcpanic.9",   0x0000, 0x0800, 0xeec78b4c )
  1365.     ROM_LOAD( "spcpanic.10",  0x0800, 0x0800, 0xc9631c2d )
  1366.     ROM_LOAD( "spcpanic.12",  0x1000, 0x0800, 0xe83423d0 )
  1367.     ROM_LOAD( "spcpanic.11",  0x1800, 0x0800, 0xacea9df4 )
  1368.  
  1369.     ROM_REGION( 0x0020, REGION_PROMS )
  1370.     ROM_LOAD( "82s123.sp",    0x0000, 0x0020, 0x35d43d2f )
  1371.  
  1372.     ROM_REGION( 0x0800, REGION_USER1 ) /* color map */
  1373.     ROM_LOAD( "spcpanic.8",   0x0000, 0x0800, 0x7da0b321 )
  1374. ROM_END
  1375.  
  1376. ROM_START( panicger )
  1377.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1378.     ROM_LOAD( "spacepan.001", 0x0000, 0x0800, 0xa6d9515a )
  1379.     ROM_LOAD( "spacepan.002", 0x0800, 0x0800, 0xcfc22663 )
  1380.     ROM_LOAD( "spacepan.003", 0x1000, 0x0800, 0xe1f36893 )
  1381.     ROM_LOAD( "spacepan.004", 0x1800, 0x0800, 0x01be297c )
  1382.     ROM_LOAD( "spacepan.005", 0x2000, 0x0800, 0xe0d54805 )
  1383.     ROM_LOAD( "spacepan.006", 0x2800, 0x0800, 0xaae1458e )
  1384.     ROM_LOAD( "spacepan.007", 0x3000, 0x0800, 0x14e46e70 )
  1385.  
  1386.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1387.     ROM_LOAD( "spcpanic.9",   0x0000, 0x0800, 0xeec78b4c )
  1388.     ROM_LOAD( "spcpanic.10",  0x0800, 0x0800, 0xc9631c2d )
  1389.     ROM_LOAD( "spcpanic.12",  0x1000, 0x0800, 0xe83423d0 )
  1390.     ROM_LOAD( "spcpanic.11",  0x1800, 0x0800, 0xacea9df4 )
  1391.  
  1392.     ROM_REGION( 0x0020, REGION_PROMS )
  1393.     ROM_LOAD( "82s123.sp",    0x0000, 0x0020, 0x35d43d2f )
  1394.  
  1395.     ROM_REGION( 0x0800, REGION_USER1 ) /* color map */
  1396.     ROM_LOAD( "spcpanic.8",   0x0000, 0x0800, 0x7da0b321 )
  1397. ROM_END
  1398.  
  1399. ROM_START( cosmica )
  1400.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1401.     ROM_LOAD( "ca.e3",        0x0000, 0x0800, 0x535ee0c5 )
  1402.     ROM_LOAD( "ca.e4",        0x0800, 0x0800, 0xed3cf8f7 )
  1403.     ROM_LOAD( "ca.e5",        0x1000, 0x0800, 0x6a111e5e )
  1404.     ROM_LOAD( "ca.e6",        0x1800, 0x0800, 0xc9b5ca2a )
  1405.     ROM_LOAD( "ca.e7",        0x2000, 0x0800, 0x43666d68 )
  1406.  
  1407.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* sprites */
  1408.     ROM_LOAD( "ca.n1",        0x0000, 0x0800, 0x431e866c )
  1409.     ROM_LOAD( "ca.n2",        0x0800, 0x0800, 0xaa6c6079 )
  1410.  
  1411.     ROM_REGION( 0x0020, REGION_PROMS )
  1412.     ROM_LOAD( "ca.d9",        0x0000, 0x0020, 0xdfb60f19 )
  1413.  
  1414.     ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
  1415.     ROM_LOAD( "ca.e2",        0x0000, 0x0400, 0xea4ee931 )
  1416.  
  1417.     ROM_REGION( 0x0400, REGION_USER2 ) /* starfield generator */
  1418.     ROM_LOAD( "ca.sub",       0x0000, 0x0400, 0xacbd4e98 )
  1419. ROM_END
  1420.  
  1421. ROM_START( cosmica2 )
  1422.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1423.     ROM_LOAD( "ca.e3",        0x0000, 0x0800, 0x535ee0c5 )
  1424.     ROM_LOAD( "c3.bin",       0x0800, 0x0400, 0x699c849e )
  1425.     ROM_LOAD( "d4.bin",       0x0c00, 0x0400, 0x168e38da )
  1426.     ROM_LOAD( "ca.e5",        0x1000, 0x0800, 0x6a111e5e )
  1427.     ROM_LOAD( "ca.e6",        0x1800, 0x0800, 0xc9b5ca2a )
  1428.     ROM_LOAD( "i9.bin",       0x2000, 0x0400, 0x3bb57720 )
  1429.     ROM_LOAD( "j0.bin",       0x2400, 0x0400, 0x4ff70f45 )
  1430.  
  1431.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* sprites */
  1432.     ROM_LOAD( "ca.n1",        0x0000, 0x0800, 0x431e866c )
  1433.     ROM_LOAD( "ca.n2",        0x0800, 0x0800, 0xaa6c6079 )
  1434.  
  1435.     ROM_REGION( 0x0020, REGION_PROMS )
  1436.     ROM_LOAD( "ca.d9",        0x0000, 0x0020, 0xdfb60f19 )
  1437.  
  1438.     ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
  1439.     ROM_LOAD( "ca.e2",        0x0000, 0x0400, 0xea4ee931 )
  1440.  
  1441.     ROM_REGION( 0x0400, REGION_USER2 ) /* starfield generator */
  1442.     ROM_LOAD( "ca.sub",       0x0000, 0x0400, 0xacbd4e98 )
  1443. ROM_END
  1444.  
  1445. ROM_START( cosmicg )
  1446.     ROM_REGION( 0x10000, REGION_CPU1 )  /* 8k for code */
  1447.     COSMICG_ROM_LOAD( "cosmicg1.bin",  0x0000, 0x0400, 0xe1b9f894 )
  1448.     COSMICG_ROM_LOAD( "cosmicg2.bin",  0x0400, 0x0400, 0x35c75346 )
  1449.     COSMICG_ROM_LOAD( "cosmicg3.bin",  0x0800, 0x0400, 0x82a49b48 )
  1450.     COSMICG_ROM_LOAD( "cosmicg4.bin",  0x0C00, 0x0400, 0x1c1c934c )
  1451.     COSMICG_ROM_LOAD( "cosmicg5.bin",  0x1000, 0x0400, 0xb1c00fbf )
  1452.     COSMICG_ROM_LOAD( "cosmicg6.bin",  0x1400, 0x0400, 0xf03454ce )
  1453.     COSMICG_ROM_LOAD( "cosmicg7.bin",  0x1800, 0x0400, 0xf33ebae7 )
  1454.     COSMICG_ROM_LOAD( "cosmicg8.bin",  0x1C00, 0x0400, 0x472e4990 )
  1455.  
  1456.     ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
  1457.     ROM_LOAD( "cosmicg9.bin",  0x0000, 0x0400, 0x689c2c96 )
  1458. ROM_END
  1459.  
  1460. ROM_START( magspot2 )
  1461.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1462.     ROM_LOAD( "ms.e3",   0x0000, 0x0800, 0xc0085ade )
  1463.     ROM_LOAD( "ms.e4",   0x0800, 0x0800, 0xd534a68b )
  1464.     ROM_LOAD( "ms.e5",   0x1000, 0x0800, 0x25513b2a )
  1465.     ROM_LOAD( "ms.e7",   0x1800, 0x0800, 0x8836bbc4 )
  1466.     ROM_LOAD( "ms.e6",   0x2000, 0x0800, 0x6a08ab94 )
  1467.     ROM_LOAD( "ms.e8",   0x2800, 0x0800, 0x77c6d109 )
  1468.  
  1469.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* sprites */
  1470.     ROM_LOAD( "ms.n1",   0x0000, 0x0800, 0x1ab338d3 )
  1471.     ROM_LOAD( "ms.n2",   0x0800, 0x0800, 0x9e1d63a2 )
  1472.  
  1473.     ROM_REGION( 0x0020, REGION_PROMS )
  1474.     ROM_LOAD( "ms.d9",   0x0000, 0x0020, 0x36e2aa2a )
  1475.  
  1476.     ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
  1477.     ROM_LOAD( "ms.e2",   0x0000, 0x0400, 0x89f23ebd )
  1478. ROM_END
  1479.  
  1480. ROM_START( devzone )
  1481.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1482.     ROM_LOAD( "dv1.e3",  0x0000, 0x0800, 0xc70faf00 )
  1483.     ROM_LOAD( "dv2.e4",  0x0800, 0x0800, 0xeacfed61 )
  1484.     ROM_LOAD( "dv3.e5",  0x1000, 0x0800, 0x7973317e )
  1485.     ROM_LOAD( "dv5.e7",  0x1800, 0x0800, 0xb71a3989 )
  1486.     ROM_LOAD( "dv4.e6",  0x2000, 0x0800, 0xa58c5b8c )
  1487.     ROM_LOAD( "dv6.e8",  0x2800, 0x0800, 0x3930fb67 )
  1488.  
  1489.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* sprites */
  1490.     ROM_LOAD( "dv7.n1",  0x0000, 0x0800, 0xe7562fcf )
  1491.     ROM_LOAD( "dv8.n2",  0x0800, 0x0800, 0xda1cbec1 )
  1492.  
  1493.     ROM_REGION( 0x0020, REGION_PROMS )
  1494.     ROM_LOAD( "ms.d9",   0x0000, 0x0020, 0x36e2aa2a )
  1495.  
  1496.     ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
  1497.     ROM_LOAD( "dz9.e2",  0x0000, 0x0400, 0x693855b6 )
  1498. ROM_END
  1499.  
  1500. ROM_START( nomnlnd )
  1501.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1502.     ROM_LOAD( "1.bin",  0x0000, 0x0800, 0xba117ba6 )
  1503.     ROM_LOAD( "2.bin",  0x0800, 0x0800, 0xe5ed654f )
  1504.     ROM_LOAD( "3.bin",  0x1000, 0x0800, 0x7fc42724 )
  1505.     ROM_LOAD( "5.bin",  0x1800, 0x0800, 0x9cc2f1d9 )
  1506.     ROM_LOAD( "4.bin",  0x2000, 0x0800, 0x0e8cd46a )
  1507.     ROM_LOAD( "6.bin",  0x2800, 0x0800, 0xba472ba5 )
  1508.  
  1509.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* sprites */
  1510.     ROM_LOAD( "nml7.n1",  0x0000, 0x0800, 0xd08ed22f )
  1511.     ROM_LOAD( "nml8.n2",  0x0800, 0x0800, 0x739009b4 )
  1512.  
  1513.     ROM_REGION( 0x0800, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* tree + river */
  1514.     ROM_LOAD( "nl11.ic7", 0x0000, 0x0400, 0xe717b241 )
  1515.     ROM_LOAD( "nl10.ic4", 0x0400, 0x0400, 0x5b13f64e )
  1516.  
  1517.     ROM_REGION( 0x0020, REGION_PROMS )
  1518.     ROM_LOAD( "nml.clr",  0x0000, 0x0020, 0x65e911f9 )
  1519.  
  1520.     ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
  1521.     ROM_LOAD( "nl9.e2",   0x0000, 0x0400, 0x9e05f14e )
  1522. ROM_END
  1523.  
  1524. ROM_START( nomnlndg )
  1525.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1526.     ROM_LOAD( "nml1.e3",  0x0000, 0x0800, 0xe212ed91 )
  1527.     ROM_LOAD( "nml2.e4",  0x0800, 0x0800, 0xf66ef3d8 )
  1528.     ROM_LOAD( "nml3.e5",  0x1000, 0x0800, 0xd422fc8a )
  1529.     ROM_LOAD( "nml5.e7",  0x1800, 0x0800, 0xd58952ac )
  1530.     ROM_LOAD( "nml4.e6",  0x2000, 0x0800, 0x994c9afb )
  1531.     ROM_LOAD( "nml6.e8",  0x2800, 0x0800, 0x01ed2d8c )
  1532.  
  1533.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* sprites */
  1534.     ROM_LOAD( "nml7.n1",  0x0000, 0x0800, 0xd08ed22f )
  1535.     ROM_LOAD( "nml8.n2",  0x0800, 0x0800, 0x739009b4 )
  1536.  
  1537.     ROM_REGION( 0x0800, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* tree + river */
  1538.     ROM_LOAD( "nl11.ic7", 0x0000, 0x0400, 0xe717b241 )
  1539.     ROM_LOAD( "nl10.ic4", 0x0400, 0x0400, 0x5b13f64e )
  1540.  
  1541.     ROM_REGION( 0x0020, REGION_PROMS )
  1542.     ROM_LOAD( "nml.clr",  0x0000, 0x0020, 0x65e911f9 )
  1543.  
  1544.     ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
  1545.     ROM_LOAD( "nl9.e2",   0x0000, 0x0400, 0x9e05f14e )
  1546. ROM_END
  1547.  
  1548.  
  1549.  
  1550. GAME( 1979, cosmicg,  0,       cosmicg,  cosmicg,  cosmicg, ROT270, "Universal", "Cosmic Guerilla" )
  1551. GAMEX(1979, cosmica,  0,       cosmica,  cosmica,  0,       ROT270, "Universal", "Cosmic Alien", GAME_NO_SOUND )
  1552. GAMEX(1979, cosmica2, cosmica, cosmica,  cosmica,  0,       ROT270, "Universal", "Cosmic Alien (older)", GAME_NO_SOUND )
  1553. GAME( 1980, panic,    0,       panic,    panic,    0,       ROT270, "Universal", "Space Panic (set 1)" )
  1554. GAME( 1980, panica,   panic,   panic,    panic,    0,       ROT270, "Universal", "Space Panic (set 2)" )
  1555. GAME( 1980, panicger, panic,   panic,    panic,    0,       ROT270, "Universal (ADP Automaten license)", "Space Panic (German)" )
  1556. GAMEX(1980, magspot2, 0,       magspot2, magspot2, 0,       ROT270, "Universal", "Magical Spot II", GAME_IMPERFECT_SOUND )
  1557. GAMEX(1980, devzone,  0,       magspot2, devzone,  0,       ROT270, "Universal", "Devil Zone", GAME_IMPERFECT_SOUND )
  1558. GAMEX(1980?,nomnlnd,  0,       nomnlnd,  nomnlnd,  0,       ROT270, "Universal", "No Man's Land", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
  1559. GAMEX(1980?,nomnlndg, nomnlnd, nomnlnd,  nomnlnd,  0,       ROT270, "Universal (Gottlieb license)", "No Man's Land (Gottlieb)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
  1560.